<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<a href="">Onclick Event</a>
</body>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
    var a = document.getElementsByTagName('a')[0];
    a.on('click', function (event) {
        event.preventDefault();
        var link = $(event.target).attr('href');
        console.log("The link clicked had a URL of: " + link);
    })
</script>
</html>